package com.kx.ssm.utils;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @ClassName ExecutorUtil
 * @Author Sun
 * @Date 2021/5/23 12:59
 */
public class ExecutorUtils {
    private static ThreadPoolExecutor executor=new ThreadPoolExecutor(10, 30, 5000, TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>(), Executors.defaultThreadFactory(),new ThreadPoolExecutor.CallerRunsPolicy());

    public static void submit(Runnable runnable){
        executor.execute(runnable);
    }
}
